package com.itheima.practice2;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Test {
    //    //2.讲三个元注解练习一遍，验证结果.
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Class aClass = Class.forName("com.itheima.practice2.Person");
        Person p = (Person) aClass.newInstance();
        Method[] declaredMethods = aClass.getDeclaredMethods();
        for (Method declaredMethod : declaredMethods) {
            if(declaredMethod.isAnnotationPresent(Running.class)){
                declaredMethod.invoke(p);
            }
        }
    }
}
